import config from '../../config/config'
import axios from 'axios'

//配置公共的请求头
axios.defaults.baseURL = config.baseURL
// 配置超时时间
axios.defaults.timeout = 3000;
//配置公共的post的Content-Type
axios.defaults.headers.post['Content-Type'] = 'application/json';

const sendCommand = async(path, data, prefix="send_msg")=>{
    const api = `/${prefix}/${path}`
    var ret = await axios.post(api, data);
    console.log(ret)
    return ret.data;
}

export default {
    sendCommand
}


